﻿using System.Reflection;
using NUnit.Framework;
using Assume = DiffLib.QA.Assume;

namespace DiffLib.Tests.QA
{
    [TestFixture]
    public class EncapsulationTests : QualityTestsBase
    {
        [Test]
        [TestCaseSource("AllPublicFields")]
        public void PublicField_ShouldNotBeExposed(FieldInfo publicField)
        {
            Assume.That(publicField.DeclaringType != null);
            Assert.Fail("Public field " + publicField.Name + " of type " + publicField.DeclaringType.FullName + " should not have been exposed");
        }
    }
}
